Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Auth page when user login #107

Merged
merged 7 commits into from
Feb 25, 2024
Merged

Conversation

jsun969
Copy link
Member

@jsun969 jsun969 commented Feb 24, 2024

Description

Add logic to verify user when visit auth page

Changes Made

  • Convert all pages to server components
  • Fix middleware, add clerk fallback url in env
  • Add logic to verify user in auth page
  • Add missing metadata

Related Issues

N/A

Additional Notes

N/A

@jsun969 jsun969 requested a review from rayokamoto February 24, 2024 10:45
Copy link

vercel bot commented Feb 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 25, 2024 11:35am

NEXT_PUBLIC_CLERK_SIGN_IN_URL=/signin
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/join
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this to be the home page or should it be /settings in the membership tab so that people have direct access to pay?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aftersignin here is not the main logic. if you want this, we have to do it code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for, like google login, redirect url

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, okay

src/env.mjs Show resolved Hide resolved
src/middleware.ts Show resolved Hide resolved
publicRoutes: (req) => {
return !authRoutes.includes(req.nextUrl.pathname);
},
publicRoutes: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also add /not-found?

src/env.mjs Outdated
@@ -15,10 +15,19 @@ export const env = createEnv({
client: {
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().min(1),
NEXT_PUBLIC_DRIVE_LINK: z.string().url().min(1),
// Clerk URLs. Redundant, but there is no other way from Clerk.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might reword this a bit but the general idea is there.

@rayokamoto rayokamoto merged commit 8e7e15b into main Feb 25, 2024
4 checks passed
@rayokamoto rayokamoto deleted the fix/metadata-middleware-auth branch February 25, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants